<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Cat extends Model
{
    use HasFactory;
	
	protected $primaryKey = 'cat_id';
	
	public function arts()
    {
		//第一个cat_id是文章表的分类id，第二个是分类表id
        return $this->hasMany(Art::class,'cat_id','cat_id');
    }
	
	
}
